<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>11响应式布局-响应式导航</title>
    <style>
        body {
            min-width: 320px;
        }
        
        * {
            margin: 0;
            padding: 0;
        }
        
        li {
            list-style: none;
        }
        
        .container {
            width: 750px;
            margin: 50px auto;
        }
        
        .container ul li {
            float: left;
            height: 30px;
            width: 93.75px;
            line-height: 30px;
            text-align: center;
            background-color: green;
            color: #fff;
        }
        
        @media screen and (max-width:767px) {
            .container {
                width: 100%;
            }
            .container ul li {
                width: 25%;
                margin-top: 10px;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <ul>
            <li>导航栏1</li>
            <li>导航栏2</li>
            <li>导航栏3</li>
            <li>导航栏4</li>
            <li>导航栏5</li>
            <li>导航栏6</li>
            <li>导航栏7</li>
            <li>导航栏8</li>
        </ul>
    </div>
</body>

</html>